package com.myjianzhu.zzt88.exercise.android.databinding;

import android.app.Activity;
import android.content.Intent;
import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.ActivityCompat;
import android.support.v7.app.AppCompatActivity;

import com.myjianzhu.zzt88.exercise.R;
import com.myjianzhu.zzt88.exercise.databinding.ActivityDataBindingBinding;

public class DataBindingActivity extends AppCompatActivity {


    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityDataBindingBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_data_binding);
        UserBean user = new UserBean("Gamin", 23,"15989458619");
        binding.setUser(user);
    }

    public static void start(Activity activity) {
        Intent intent = new Intent(activity, DataBindingActivity.class);
        ActivityCompat.startActivity(activity, intent, null);
    }
}
